<extend name="Public/base"/>

<block name="body">
    <script type="text/javascript" src="__STATIC__/ColorPicker/jquery.js"></script>
    <script type="text/javascript" src="__STATIC__/ColorPicker/jquery.colorpicker.js"></script>
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>添加商品</h2>
    </div>
    <ul class="tab-nav nav">
        <li class="current"><a href="javascript:void(0)">基本信息</a></li>
    </ul>
    <form action="{:U()}" method="post" class="form-horizontal">
        <div class="tab-content">
            <div class="form-item">
                <label class="item-label">商品名称</label>
                <div class="controls">
                    <input type="text" class="text input-large" name="goods_name" value="{$list['goods_name']}">
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">商品价格</label>
                <div class="controls">
                    <input type="radio"  name="price_type" value="1" onclick="choose_price1()" <?php if($list['price_type']==1){echo 'checked';} ?>>详细价格
                    <input type="radio"  name="price_type" value="2" onclick="choose_price2()" <?php if($list['price_type']==2){echo 'checked';} ?>>面议
                </div>
                <div class="controls">
                    <input type="text" class="text input-large" name="goods_price" id="goods_price" <?php if($list['price_type']==2){?>style="display: none;"<?php } ?>  placeholder="请输入详细价格" value="{$list['goods_price']}">
                    <input type="text" class="text input-large" name="goods_tel" id="goods_tel" <?php if($list['price_type']==1){?>style="display: none;"<?php } ?> placeholder="请输入联系电话" value="{$list['goods_tel']}">
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">商品重量</label>
                <div class="controls">
                    <input type="text" class="text input-large" name="goods_weight" value="{$list['goods_weight']}">
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">商品销量</label>
                <div class="controls">
                    <input type="text" class="text input-large" name="sales_volume" value="{$list['sales_volume']}">
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">库存量</label>
                <div class="controls">
                    <input type="text" class="text input-large" name="stock" value="{$list['stock']}">
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">商品规格</label>
                <div class="controls">
                    <input type="text" class="text input-large" name="size" value="{$list['size']}">
                </div>
            </div>
            <div class="form-item">
                <input type="hidden" name="id" value="{$list['id']}">
                <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
                <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
            </div>
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Goods/index')}');
    </script>
    <script type="text/javascript">
        function choose_price1() {
            $('#goods_price').css("display",'block');
            $('#goods_tel').css("display",'none');
        }
        function choose_price2() {
            $('#goods_price').css("display",'none');
            $('#goods_tel').css("display",'block');
        }
    </script>
</block>
